<extend name="Public/base"/>

<block name="body">
    <script type="text/javascript" src="__STATIC__/uploadify/jquery.uploadify.min.js"></script>
    <div class="main-title">
        <h2>
            <if condition="ACTION_NAME eq 'add'">
                新增平台
            <else/>
                编辑平台【{$app_name}】
            </if>
            
            <button class="btn btn-default btn-return" onclick="javascript:history.back(-1);return false;"><i class="glyphicon glyphicon-share-alt"></i> 返 回</button>
        </h2>
    </div>
    <form action="" method="post" class="form">
        <div class="form-item form-group">
            <label class="item-label">平台名称<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text form-control input-large" name="app_name" value="{$app_name}">
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">前缀标识<span class="check-tips">(所有的用户昵称, 用户名添加 标识_ 为前缀 ,  不能修改)</span></label>
            <div class="controls">
                <input type="text" <if condition="ACTION_NAME eq 'edit'">readonly="readonly"</if> class="text form-control input-large" <if condition="ACTION_NAME eq 'add'">name="app_code"</if> value="{$app_code}">
            </div>
        </div>
        <if condition="ACTION_NAME eq 'edit'">
            <div class="form-item form-group">
                <label class="item-label">APP_ID<span class="check-tips"></span></label>
                <div class="controls">
                    {$app_id}
                </div>
            </div>
            <div class="form-item form-group">
                <label class="item-label">APP_SECRET<span class="check-tips"></span></label>
                <div class="controls">
                    {$app_secret}
                </div>
            </div>
        </if>
        <div class="form-item form-group">
            <label class="item-label">相关游戏<span class="check-tips"></span></label>
            <div class="controls">
                <volist name="allGames" id="g">
                    <label class="checkbox-inline">
                        <input class="checkbox" type="checkbox" name="games[]" value="{$key}" <in name="g" value="games">checked </in> /> {$g}
                    </label>
                </volist>    
            </div>
        </div>
        <div class="form-item form-group">
            <label class="item-label">网址<span class="check-tips"></span></label>
            <div class="controls">
                <input type="text" class="text form-control input-large" name="data[url]" value="{$data.url}">
            </div>
        </div>
        
        <div class="form-item form-group form-action">
            <input type="hidden" name="id" value="{$id}" />
            <input type="hidden" name="status" value="1" />
            <button class="btn submit-btn ajax-post btn-success btn-block" id="submit" type="submit" target-form="form">确 定</button>
        </div>
    </form>
</block>

<block name="script">
    <script type="text/javascript">
        //导航高亮
        highlight_subnav('{:U('index')}');
    </script>
</block>
